FROM python:3.9-slim

WORKDIR /opt/flink

RUN rm -f /etc/apt/apt.conf.d/docker-clean && \
    echo 'APT::Update::Post-Invoke-Success "exit 0";' > /etc/apt/apt.conf.d/99fix
RUN apt-get update && \
    apt-get install -y --no-install-recommends gcc libc-dev python3-dev && \
    rm -rf /var/lib/apt/lists/*
COPY apache_flink-1.17.1-cp39-cp39-manylinux2014_x86_64.whl .
COPY clean_user.py .

RUN pip3 install --no-cache-dir \
        numpy==1.21.6 \
        Cython==0.29.36 \
        pyarrow==8.0.0 && \
    pip3 install ./apache_flink-1.17.1-cp39-cp39-manylinux2014_x86_64.whl
CMD ["python3", "clean_user.py"]
